<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Bandit-Blog前台</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/public.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/type.css">
</head>
<body>
<%
    request.setAttribute("type","layui-this");
%>
<c:import url="commons/header.jsp"></c:import>

<div class="layui-container">

    <!-- 上边界 -->
    <div class="layui-edge-top"> </div>
    <div class="layui-edge-top layui-show-sm-block layui-hide-lg"></div>
    <div class="layui-row">
        <!-- 头 -->
        <div class="layui-col-lg12 layui-col-sm12">
            <div class="layui-card header-card">
                <div class="layui-card-header">
                    <span class="layui-breadcrumb">
                      <a href="/toIndex">首页</a>
                      <a href="">搜索内容：${searchInfo}</a>
                    </span>

                </div>
            </div>
        </div>
        <hr>
        <!-- 中间 -->
        <div class="layui-col-lg12 layui-col-sm12">
            <div class="layui-col-sm12 layui-col-lg12" id="ajaxList">
                <!-- 一篇博客 -->
                <c:if test="${empty blogList}">
                    <div class="layui-card">
                        <div class="layui-card-body blog-body">
                            Null
                        </div>
                    </div>
                </c:if>

                <c:forEach items="${blogList}" var="blog">
                    <div class="layui-card layui-anim layui-anim-scaleSpring">
                        <div class="layui-card-header blog-title">
                            <a href="/toDetails?id=${blog.id}">
                                <h2>${blog.title}</h2>
                            </a>
                        </div>
                        <div class="layui-card-body blog-body">
                            <a href="/toDetails?id=${blog.id}">
                                <h4>${blog.summary}</h4>
                            </a>
                        </div>
                        <hr>
                        <div class="layui-card-header">
                            <div class="blog-footer">
                                <i class="layui-icon">&#xe756;</i>${blog.clickHit}
                                <i class="layui-icon">&#xe611;</i>${blog.commentHit}
                            </div>
                        </div>
                    </div>
                </c:forEach>
            </div>
            <!-- 尾 -->
            <div class="layui-col-lg12 layui-col-sm12">
                <div class="layui-card">
                    <div class="layui-card-body footer-card">
                        卡片式面板面板通常用于非白色背景色的主体内
                        从而映衬出边框投影
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<br>
<c:import url="commons/footer.jsp"></c:import>
<!-- 脚本 -->
<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    //JS
    layui.use(['element', 'layer', 'util', 'laydate','carousel'], function () {
        var element = layui.element,
            laydate = layui.laydate,
            layer = layui.layer,
            util = layui.util,
            carousel = layui.carousel,
            $ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            menuRight: function () {
                layer.open({
                    type: 1,
                    content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
                    area: ['260px', '100%'],
                    offset: 'rt' //右上角
                    ,
                    anim: 5,
                    shadeClose: true
                });
            }
        });
        //日历
        laydate.render({
            elem: '#date',
            position: 'static',
            value: new Date(),
            calendar: true
        });
        //轮播
        carousel.render({
            elem: '#carouse',
            width: '100%', //设置容器宽度
            arrow: 'always' //始终显示箭头
            //anim: 'updown' //切换动画方式
        });
    });
</script>
</body>
</html>
